﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace StorageInterface.Dialogs
{
    /// <summary>
    /// Interaction logic for SpisaneDialog.xaml
    /// </summary>
    public partial class SpisaneDialog : Window
    {
        public SpisaneDialog(Window win)
        {
            
            InitializeComponent();
            this.Owner = win;
            comboBox1.ItemsSource = Data.GetAllProducts();
            comboBox2.ItemsSource = Data.GetAllStorages();
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {

        }

        double count = 0;
        private void comboBox1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            count = Data.GetAvaibleAmount(comboBox2.SelectedItem as Storage, comboBox1.SelectedItem as Product);
            textBox1.Text = count.ToString();
        }
    }
}
